package structures;
import java.util.Arrays;

import pack.MyReader;

public class CardEventRecord extends TypeAbstract{
	
	public static int size = 24;
	public byte[] emptyValue = {0,0,0,0,0,0,0,0,0,0,0,32,32,32,32,32,32,32,32,32,32,32,32,32};
	
	public final EventFaultType eventType;
	public final TimeReal eventBeginTime;
	public final TimeReal eventEndTime;
	public final VehicleRegistrationIdentification eventVehicleRegistration;
	public final int startOffset;
	
	public CardEventRecord(MyReader reader)
	{
		if(size != 0 && emptyValue != null){
			empty = Arrays.equals(reader.read(size), emptyValue);
			reader.offset -= size;
		}
		
		startOffset = reader.offset;
		eventType = new EventFaultType(reader);
		eventBeginTime = new TimeReal(reader);
		eventEndTime = new TimeReal(reader);
		eventVehicleRegistration = new VehicleRegistrationIdentification(reader);
	}
}
